93a5830f6567c2073a453abf0b74cdce6f0a1259,testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/mdb/messagedrivencontext/SimpleMDB.java,SimpleMDB,onMessage,#Message#,89
Before Change
if (message.getJMSReplyTo() != null) {
logger.info("Replying to " + message.getJMSReplyTo());
final Destination destination = message.getJMSReplyTo();
final MessageProducer replyProducer = session.createProducer(destination);
final Message replyMsg;
if (this.messageDrivenContext != null) {
replyMsg = session.createTextMessage(SUCCESS_REPLY);
} else {
replyMsg = session.createTextMessage(FAILURE_REPLY);
}
replyMsg.setJMSCorrelationID(message.getJMSMessageID());
replyProducer.send(replyMsg);
replyProducer.close();
}
} catch (JMSException jmse) {
throw new RuntimeException(jmse);
After Change
public void onMessage(Message message) {
logger.info("Received message: " + message);
try {
final Destination replyTo = message.getJMSReplyTo();
if (replyTo != null) {
logger.info("Replying to " + replyTo);
try (
JMSContext context = factory.createContext()
) {
String reply = (messageDrivenContext != null) ? SUCCESS_REPLY : FAILURE_REPLY;
context.createProducer()
.setJMSCorrelationID(message.getJMSMessageID())
.send(replyTo, reply);
}
}
} catch (JMSException jmse) {